package goylc

/////////////////////////////////// raw ///////////////////////////////////////
type GoylcStateIdSet struct {
	container map[GoylcStateId]struct{}
}

func (set *GoylcStateIdSet) Add(some GoylcStateId) {
	set.container[some] = struct{}{}
}

func (set *GoylcStateIdSet) Clear() {
	set.container = map[GoylcStateId]struct{}{}
}

func (set *GoylcStateIdSet) Remove(some GoylcStateId) {
	delete(set.container, some)
}

func (set *GoylcStateIdSet) Contains(some GoylcStateId) bool {
	_, ok := set.container[some]
	return ok
}

func (set *GoylcStateIdSet) Len() int64 {
	size := int64(len(set.container))
	return size
}

func (set *GoylcStateIdSet) Pop() GoylcStateId {
	var val GoylcStateId = GoylcStateIdNil
	for k, _ := range set.container {
		val = k
		break
	}

	set.Remove(val)
	return val
}

func NewGoylcStateIdSet() *GoylcStateIdSet {
	return &GoylcStateIdSet{
		container: make(map[GoylcStateId]struct{}, 10),
	}
}
